fix(test): out-of-process watchdog for the httpapi exerciser - #177
Merged
Conversation
2026-08-05 CI incident: the effect-mode run froze for 13 minutes with zero output after "worktree.create: shared use done" until the 15m step timeout. The scenario timeout and the bounded() cleanup guards are all timer-based — they cannot fire when a native-level hang (instance dispose / tree-sitter / sqlite teardown) freezes the event loop itself, which is the class of failure the 2026-07-27 hardening did not cover. The only guard that survives a frozen event loop is a separate process: - the runner heartbeats a file on every scenario/phase transition (--progress mode, i.e. CI) - a child process polls it every 5s; after 120s of silence it prints the last recorded scenario/phase and SIGKILLs the runner - a silent 15-minute freeze becomes a 2-minute attributed failure; the step timeout stays as the final backstop Verified: worktree scenario subset passes with the watchdog armed; a synthetic event-loop freeze is killed in ~4s (3s timeout + poll) with the last-activity diagnostic, exit 137.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
起因(2026-08-05 CI 事故)
merge #176 推 main 触发的全量 CI(run 30968399761)中,
Run HttpAPI Exerciser Gates在worktree.create: shared use done之后静默卡死 13 分钟直到步骤 15 分钟硬超时。重跑即过(同代码 40 分钟前在 dev 也全绿)——罕见 flake,非 #176 引入的回归。根因分析
exerciser 现有的两层防线都是基于定时器的:
Effect.timeoutOrElse)——Effect 中断无法打断阻塞在永不 settle 的原生 Promise / 卡死原生调用上的 fiberbounded()清理守卫——用setTimeout + Promise.race兜底两层都要求 JS 事件循环还在转。本次卡死的形态(13 分钟零输出)说明事件循环整体冻结(实例 dispose / tree-sitter / sqlite 原生清理死锁类)——此时所有进程内守卫与事件循环同归于尽,什么都不会触发。
能救冻结事件循环的守卫只有独立进程。
修复
--progress模式,即 CI)验证
[watchdog] no progress for 4s; last activity: phase-two: about to freeze — killing pid,exit 137